package com.zq.ssmdemo.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zq.ssmdemo.mapper.PositionsMapper;
import com.zq.ssmdemo.pojo.Positions;
import com.zq.ssmdemo.service.IPositionsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 职位信息表 服务实现类
 * </p>
 *
 * @author 张乔
 * @since 2024-06-09
 */
@Service
public class PositionsServiceImpl  implements IPositionsService {
@Resource
    private PositionsMapper positionsMapper;


    @Override
    public PageInfo<Positions> selectPage(Integer page, Integer limit) {
        PageHelper.startPage(page, limit);
        PageInfo<Positions> pageInfo = new PageInfo<>(positionsMapper.selectList(null));
        return pageInfo;

    }

    @Override
    public void add(Positions positions) {
        positionsMapper.insert(positions);
    }

    @Override
    public void update(Positions positions) {
positionsMapper.updateByIdssss(positions);
    }

    @Override
    public void deleteById(Integer id) {
positionsMapper.deleteByIdssss(id);
    }
}
